package cn.nawang.ebeim.api.controller;

import java.util.HashMap;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import cn.nawang.ebeim.api.service.StorageStrategyService;
import cn.nawang.ebeim.api.utils.Constant;

/**
 * @ClassName: StorageStrategyController
 * @Description: TODO
 * @author fanyb
 * @date Aug 25, 2015 8:34:39 AM
 * @version v1.0
 */
@RestController
public class StorageStrategyController {
  private static final Logger LOG = LoggerFactory.getLogger(StorageStrategyController.class);
  
  @Autowired
  private StorageStrategyService storageStrategyService;
  
  /**
   * 
   * @author fanyb
   * @Description: 根据客户编号返回存储策略对象
   * @param customerId 客户编号
   * @return Map<String,Object> 结果
   * @date Aug 25, 20158:46:59 AM
   *
   * @修改人 
   * @修改日期
   */
  @RequestMapping(value="/token/storage_strategyService/find/customer_id", method = RequestMethod.GET)
  public Map<String,Object> findByCustomerId(String customerId) {
    LOG.debug("/token/storage_strategyService/find/customer_id {}", customerId);
    Map<String,Object> map = new HashMap<String,Object>();
    map.put("code", Constant.CODE_ERROR);
    map.put("object", storageStrategyService.findByCustomerId(customerId));
    map.put("code", Constant.CODE_SUCCESS);
    LOG.debug("findByCustomerId {}", customerId);
    return map;
  }
  
  
}
